/*
 * Copyright (c) 2009 Team TypeZero
 *
 * This file is part of ZebBowling
 *
 * ZebBowling is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ZebBowling is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ZebBowling. If not, see <http://www.gnu.org/licenses/>.
 **/

package org.zebbowling.world;

import java.awt.Color;
import java.awt.Graphics;

/**
 * This class is used to represent bowling pins in Zebulon Bowling.
 *
 * @author Mark Vismonte
 */
public class BowlingPin extends CanvasObject {

    /**
     * Creates a {@code BowlingPin} with specified x and y coordinates.
     *
     * @param x The x coordinate of this {@code BowlingPin}
     * @param y The y coordinate of this {@code BowlingPin}
     */
    public BowlingPin(int x, int y)
        {
        super(x,y,40,40,0,0,Color.WHITE);
        }

    private BowlingPin(int x, int y, int width, int height, int xVel, int yVel
            , Color color)
        {
        super(x,y,width,height,xVel,yVel,color);
        }


    public void draw(Graphics drawPad) {
        Color temp = drawPad.getColor();
        drawPad.setColor(getColor());
        drawPad.fillOval(getXPos(), getYPos(),
                getWidth(), getHeight());
        drawPad.setColor(Color.RED);
        drawPad.fillOval(getXPos() + getWidth()/4, getYPos() + getHeight()/4,
                getWidth()/2, getHeight()/2);
        drawPad.setColor(temp);
        }

    }
